function [sample_means sample_covars] = computeSufficientStatistics(data, vars, covar_type, reg)


[N D] = size(data.Y);
K = size(vars.Z, 2);

sample_means = zeros(K, D);
sample_covars = zeros(D, D, K);
for k = 1:K
    w = vars.Z(:, k);

    [mu sigma] = computeMLEGaussian(data, w, covar_type, reg);
    sample_means(k, :) = mu;
    sample_covars(:, :, k) = sigma;
end
